Skip to content

Add RealPath module#65

Merged
harendra-kumar merged 12 commits intomasterfrom
RealPath_module
Apr 20, 2026
Merged

Add RealPath module#65
harendra-kumar merged 12 commits intomasterfrom
RealPath_module

Conversation

@rnjtranjan
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/Streamly/Coreutils/RealPath.hs Outdated
-- and remove as many indirections from it as possible.

realPath :: FilePath -> IO FilePath
realPath = canonicalizePath
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the same. Did you test and compare the realpath coreutil and this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes:
*Streamly.Coreutils.RealPath> realPath "./test2.txt"
"/home/ranjeetr/composewell/CoreUtils/streamly-coreutils/test2.txt"
*Streamly.Coreutils.RealPath> realPath "../test2.txt"
"/home/ranjeetr/composewell/CoreUtils/test2.txt"
*Streamly.Coreutils.RealPath>

kaveri:/composewell/CoreUtils/streamly-coreutils  (monadic-predicates)$ (nix) realpath ./test2.txt
/home/ranjeetr/composewell/CoreUtils/streamly-coreutils/test2.txt
kaveri:
/composewell/CoreUtils/streamly-coreutils  (monadic-predicates)$ (nix) realpath ../test2.txt
/home/ranjeetr/composewell/CoreUtils/test2.txt
kaveri:~/composewell/CoreUtils/streamly-coreutils  (RealPath_module)$ (nix)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same behaviors for symlink and nonexistent files.
*Streamly.Coreutils.RealPath> realPath "./ls.txt"
"/home/ranjeetr/composewell/CoreUtils/streamly-coreutils/test2.txt"
*Streamly.Coreutils.RealPath> realPath "../lsssss.txt"
"/home/ranjeetr/composewell/CoreUtils/lsssss.txt

@harendra-kumar
Copy link
Copy Markdown
Member

Try testing on a symlink and on non-existing files.

@harendra-kumar harendra-kumar merged commit 6872df1 into master Apr 20, 2026
12 of 13 checks passed
@harendra-kumar harendra-kumar deleted the RealPath_module branch April 21, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants